//
//  SubjectSearchViewController.m
//  History
//
//  Created by jam on 16/9/5.
//  Copyright © 2016年 kane. All rights reserved.
//

#import "SubjectSearchViewController.h"

@interface SubjectSearchViewController ()<UITextFieldDelegate,UITableViewDelegate,UITableViewDataSource>
{
    
    __weak IBOutlet UITextField *searchField;
    
    __weak IBOutlet UITableView *resultTable;
    NSMutableArray *resultDataList;
}

@end

@implementation SubjectSearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    resultDataList = [NSMutableArray array];
    resultTable.hidden = YES;
    [searchField becomeFirstResponder];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark--tableviewdelegate

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return resultDataList.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return nil;
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    [searchField resignFirstResponder];
}

#pragma mark--textfielddelegate

- (void)textFieldDidBeginEditing:(UITextField *)textField
{
    resultTable.hidden = NO;
}

-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
//    NSString *text = [textField.text stringByReplacingCharactersInRange:range withString:string];
    //下面写请求数据的方法，无接口
    
    
    
    return YES;
}


- (IBAction)backBtnClick:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
